//
//  RanBlingLabel.m
//  ThusMyStyle
//
//  Created by Ran on 15/11/12.
//  Copyright (c) 2015年 gintong. All rights reserved.
//

#import "RanBlingLabel.h"

@interface RanBlingLabel()

@property(nonatomic, strong)UIColor *orgBgColor;

@end

@implementation RanBlingLabel



- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.normalBackgroundColor = [UIColor clearColor];
        self.selectedBackgroundColor = [UIColor lightGrayColor];
        self.backgroundColor = self.normalBackgroundColor;
        
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];
        [self addGestureRecognizer:tap];
        self.orgBgColor = self.backgroundColor;
        self.userInteractionEnabled = YES;
        
        
        
    }
    return self;
}

- (void)tap: (UITapGestureRecognizer *)tapGes
{
    NSLog(@"%zd", tapGes.state);
    self.backgroundColor = [UIColor redColor];self.selectedBackgroundColor;
    if(tapGes.state == UIGestureRecognizerStateEnded || tapGes.state == UIGestureRecognizerStateCancelled){
        self.backgroundColor = self.normalBackgroundColor;
    }
}

@end
